from selenium.webdriver.common.by import By
from base import Base
class Page(Base):
    def gwc(self):
        print('点击购物车按钮')
        loc=(By.ID,'com.kongfz.app:id/lav_4')
        ele=self.find_ele(loc)
        return ele
    def ss(self):
        print('点击搜索框')
        loc=(By.XPATH, '//android.widget.TextView[@resource-id="com.kongfz.app:id/icon_font_search"]')
        ele=self.find_ele(loc)
        return ele
    def sr(self):
        print('输入搜索内容')
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    def ssanniu(self):
        print('点击搜索按钮')
        loc = (By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tv_char_search"]')
        ele = self.find_ele(loc)
        return ele
    def fh(self):
        print('点击返回按钮')
        loc = (By.ACCESSIBILITY_ID,'返回')
        ele = self.find_ele(loc)
        return ele
    def dy1(self):
        print('断言白洋淀书斋是否存在')
        loc = (By.ANDROID_UIAUTOMATOR, 'new UiSelector().text("白洋淀书斋")')
        ele = self.find_ele(loc)
        return ele
    def dy2(self):
        print('断言没有找到是否存在')
        loc = (By.ID, 'com.kongfz.app:id/tv_empty_info')
        ele = self.find_ele(loc)
        return ele